package Day05;
import java.util.Arrays;
public class ArrayDemo {
    public static void main(String[] args) {
        /*
        int[] a = new int[5];
        double[] b = new double[10];
        boolean[] c = new boolean[26];

        int [] d = new int[3];//0,0,0
        int [] e = {2,5,8};
        int [] f = new int[]{2,5,8};
        int[] arr4;
        arr4=new int[]{2,6,9};

        int[] arr=new int[3];
        System.out.println("数组的长度:"+arr.length);
        System.out.println("数组第一个元素:"+arr[0]);
        arr[0]=100;
        arr[1]=200;
        arr[2]=300;
        System.out.println(arr[0]);
        System.out.println("数组最后一个:"+arr[arr.length-1]);

        int[] arr2=new int[5];
        arr2[0]=123;
        arr2[1]=345;
        arr2[2]=567;
        arr2[4]=890;
        System.out.println(arr2[3]);
        System.out.println(arr2[arr2.length-1]);
        */
        /*
        int[] arr=new int[10];
        for (int i=0;i< arr.length;i++){
            arr[i]=(int)(Math.random()*100);
            System.out.println(arr[i]);
        }
        */
        /*
        int[] a={10,20,30,40,50};
        int[] b=new int[11];
        System.arraycopy(a,4,b,5,1);
        for (int i=0;i< b.length;i++){
            System.out.println(b[i]);
        }
        */
        int[] a={10,20,30,40,50};
        int[] b=Arrays.copyOf(a,10);
        for (int i=0;i< b.length;i++){
            System.out.println(b[i]);
        }
    }
}